i had the same menuitem in purchorder and invoice order how can i modify the record in menuitem when it called by invoiceorder and not in purchorder
Could you please describe little more regarding your requirement.
If i am not wrong then you your have only one Menu Item and you want which is going to call from two different places (1. Invoice order and 2. Purchorder ).
And you want to know from which place your menu item called. so that according that you will do function. --- please correct me if my understanding wrong?
If this is the case, then create a Base Enum with two element (1.InvoiceOrder & 2. Purchase order). and create two new menu item (1. Invoice order & 2. Purchase order) and use these baseenum in the menu item Enum parameter and then use your menu item in the respected area.
Finally over right init() method of Form - if your menu item called some Form Or over right main() method of class - if your menu item called for some class. and use below piece of code.
If you describe little more regarding your requirement then we can analysis and trying to provide better solution.
i have the same menuitem in the two forms purcorder and invoice order <imputation>
i add two record linked to the form purchorder
and in the invoice order i get the same record when i open the menuitem but if you see i deleted the first record but it have changed in purch order
So your question is why system not showing deleted (for your case first line) record in the form which is open from purchase order form. -- is it?
--- Since your form (1-Brmf) contain datasource which is common for both the form Invoice order as well as purchase order. and there is no data separator for your table because of that when you delete a record from your form (1-brmf) its deleted directly from database and because of that you are able to see only one record from both place.
Consider below example to understand your problem.
I have a form (FormXYZ) and a table associated with this form (TableZYX), I created one menu item MenuItemXYZ. and place this menu item in Invoice order and Purchase order.
Now suppose i opened MenuItemXYZ from PO form and added two line (lets as 1. Rohit and 2. Wafa1234).
Now if i open MenuItemXYZ from Invoice order form I can see these two records --- Is it happening with your form?
Now if i deleted first record (i.e. Rohit) from MenuItemZXY which was opened from invoice order form then record (Rohit) is permanently deleted from database. Now If i open MenuItemXYZ from anywhere i can't see the record (Rohit). -- And this is happening with you if I am not wrong.
And as per your requirement system should show deleted record also because that records still not deleted from Purchase order menu item. which is not possible.
If your really want to make system behave like this, then either you have to define some key in your table so that system should understand from where records are created so that while deleting the records system should check whether delete perform from same place from where its create or not. If its same place then it will allow .
Or you have to create another table to store data as per your requirement.
Let me know if I understand your requirement properly or not :)
i have create a key but it the same problem if i delete the record from Invoice it deleted from PO
I think you didn't understand my point behind the key. I mention that system should check before delete the record. So did you mention this key any validate delete method.?
Key: When we create a record from PO side some Po key (let say PO recId) need. And while we create record from Invoice order side some invoice key need. Since it's a commen form so if I open this form from Invoice side and try to delete the record which is created from PO then system should call validate delete method and check this key. If it's PO and caller is invoice then line should not allow to delete from invoice order form. -- now hoping you understand my concept behind the key
Q1: what functionality you want to achieve here?
Q2: As I already mention if table is common then this behaviour will never achieved.
Q3: why you want to see the same record and want to delete the record from another palace? What is the logic behind that?
If you really want to achieve your requirements then please do thing as mentioned below.
why not you create new set of table and form which will work for invoice order. Let say form-A for PO and form-B for Invoice when you create any record in form-A then ovride insert method and insert the same same record in another form-B and vise vera.
While you open form-B you can see the same record and you can delete the line from the same table, but will not going to delete from Po
In this way you achieve your requirements and it's a very simple one also just to copy existing form and table.
Thanks and regards
ok the point was to allow delete from invoice order and in PO i keep the same records but the problem i have the same datasource for purchline and vendinvoiceinfoline
Same issue here when I deleted the first record but it still have the same datasource for purchline.