I want to disable a column for a particular Blanket order only when an option field at Header of that order will have a particular value. How can I do this. Pls suggest.
I hope i understand you correctly.
If you want to disable a column in the subform, you can do it in the OnAfterGetRecord-Trigger of the Subform. There you can do a GET of the right Haeder-Record and set the Column visible = TRUE or FALSE as the value of your option-field says.
CASE SalesHeader.Status OF
SalesHeader.Status::Open :
CurrForm."No.".EDITABLE(TRUE);
ELSE
CurrForm."No.".EDITABLE(FALSE);
END;
you could also use the CASE option when there are more than 1 options
=================================
3. If the Options are More than 2 then Try
SalesHeader.GET("Document Type","Document No.");
IF SalesHeader.TestField IN [SalesHeader.TestField::Value1, SalesHeader.TestField::Value2,...] THEN
CurrForm."No.".EDITABLE(FALSE)
ELSE
CurrForm."No.".EDITABLE(TRUE);
Thanks for your solutions. But you know with these solutions, the column of that subform will get disabled for every order Whereas I need to do it only for that particular order whose status is "Closed" or as soon as the status is changed to closed.
Comments
I hope i understand you correctly.
If you want to disable a column in the subform, you can do it in the OnAfterGetRecord-Trigger of the Subform. There you can do a GET of the right Haeder-Record and set the Column visible = TRUE or FALSE as the value of your option-field says.
Hope this helps.
Regards,
Frank
IF Status = Status::Released THEN
CurrForm."Order Date".EDITABLE(FALSE)
ELSE
CurrForm."Order Date".EDITABLE(TRUE);
UK
OnAfterGetRecord
1.
SalesHeader.GET("Document Type","Document No.");
CurrForm."No.".EDITABLE (SalesHeader.Status=SalesHeader.Status::Open);
======================================
2.
SalesHeader.GET("Document Type","Document No.");
CASE SalesHeader.Status OF
SalesHeader.Status::Open :
CurrForm."No.".EDITABLE(TRUE);
ELSE
CurrForm."No.".EDITABLE(FALSE);
END;
you could also use the CASE option when there are more than 1 options
=================================
3. If the Options are More than 2 then Try
SalesHeader.GET("Document Type","Document No.");
IF SalesHeader.TestField IN [SalesHeader.TestField::Value1, SalesHeader.TestField::Value2,...] THEN
CurrForm."No.".EDITABLE(FALSE)
ELSE
CurrForm."No.".EDITABLE(TRUE);
Thanks for your solutions. But you know with these solutions, the column of that subform will get disabled for every order Whereas I need to do it only for that particular order whose status is "Closed" or as soon as the status is changed to closed.
Pls tell me if there is some solution.
Thanks and Regards,
Seema
Hey it got solved.
I created two functions in Subform to disable and enable the line and By calling these functions from Header - onAfterGetRecords on basis of status.
Anywayz Thanx alot,
Seema Gupta