Visualforce Page :
<apex:pageBlockSectionItem >
<apex:outputLabel >Good
Recive Note</apex:outputLabel>
<apex:panelGroup
layout="block" styleClass="requiredInput">
<apex:panelGroup
layout="block" styleClass="requiredBlock" />
<apex:outputfield
value="{!Goods_Received_Note__c.Purchase_Order__c}"
id="ddlPO" />
</apex:panelGroup>
</apex:pageBlockSectionItem>
Custom Button :
{!REQUIRESCRIPT("/soap/ajax/22.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/22.0/apex.js")}
var query = "Select
Id, Purchase_Order__c, Receive_All_Qty__c from Purchase_Order_Line_Item__c Where Purchase_Order__c=
'{!Purchase_Order__c.Id}' And Receive_All_Qty__c = false LIMIT 1";
var result =
sforce.connection.query(query);
var arrayResult =
result.getArray('records');
if (arrayResult.length
== 0)
{
alert('There are no
products for dispatch');
}
else
{
window.location.href='/apex/CreateGoodRecivefromPO?CF00N20000009EtQI={!Purchase_Order__c.Name}&CF00N20000009EtQI_lkid={!Purchase_Order__c.Id}&scontrolCaching=1&sfdc.override=1&retURL={!Purchase_Order__c.Id}';
}
No comments:
Post a Comment