Hi,
We are facing an issue while trying to customize our custom document ‘Skid Commercial Invoice.’ We added a bonus column in the cross part and want to display that column in the skid invoice. We tried using some syntax for displaying it. For example, when we display a part description, we use the syntax ‘[% Order_line.part_record.description %].’ So we tried using the syntax ‘[% order_line.part_record.cross_part_description_bc %]’ but failed. Kindly help us with this issue.
Regards,
Rana Muneeb
Hi Rana,
Bonus Columns are their own object and are handled as an object relationship. You can get an objects related bonus columns in an array like so… [% bonus_col_array = object_with_bc.get_bonus_columns %].
In your case you have a bonus column on the cross part object which is separate from the part. So first you will need to get the cross part objects array… and then for each cross part you would get the array of bonus columns.
Once you have a bonus column you can get the title and display value like so…
[% bonus_col.get_title %] [% bonus_col.display_value( object_with_bc ) %]Notice that you need to pass the object back to the bonus column display_value subroutine so that it can get the value specific to that record.
If you have any further issues you reach out to us for quote on modifying your document for you.
Thanks!
CetecERP Support
Hi, @cetecerp2
can you tell me specific syntax of my scenario. I add bonus column in cross part which technical name is “cross_part_description_bc” .
And i want to display value of this bonus column in my skid commercial invoice. So, plz tell me specific line of code.
Regards,
Rana Muneeb
Document customization is a long back and forth development process, as such we generally treat those as a billable project. Let us know if you would like to seek a quote for customizing your document.
Thanks!
CetecERP Support
@cetecerp2
I know there is a billable project. but i want to know a only one line code. how we want to display a bonus column of cross part.
Regards,
Rana Muneeb
Unfortunately, what you’re asking is much more complex than one line of code. Please allow me to elaborate:
Your first snippet is an example of how you would get the description of a specific part record, from a specific order line, [% Order_line.part_record.description %]
. The reason that is possible is because each ordline only has 1 related part record, and the description of that part is stored as part of the part record in the database directly.
The reason that it is not as easy to get to the cross part bonus column you’re asking about is because a single part record can have many related cross parts. So to get the data out of a bonus column for a specific cross part entry, there are multiple steps that you’d have to go through. You’d have to either search for or loop through every cross part related to find the cross part record related to order line and prcpart in question. Then, once you found the correct cross part record, you would be able to access the bonus columns for that cross part record.
To summarize, the reason we cannot provide you “one line of code” to accomplish this is because there isn’t a way to do what you’re asking with a single line. If you are able to take the conceptual information above and figure out how to get to what you need on your own, that’s great! However, because of the complex nature of this request, any further assistance would require billable engineering time.
If you do want us to have our engineering team work on this for you, let us know and we can get that set up. I’m sorry that this request is not something that we will be able to provide an easy answer for here on the forum.
@cetecerp13 @cetecerp2
ok send me a quotation for this.
Is the cross part description acting as a customer part description in this case? Such that you want the cross part record of type customer where it’s associated to the order customer? Will the custpart be set on the ordline and be the same as the cross part or assume that the first cross part associated with that customer is the one with the description? If there is no custpart set on the line should we leave the cross part description blank?
@cetecerp13 @cetecerp2
Yes, cross part description act as customer part description.
Basically, we add bonus coloum of Cust part description in a cross part. And we add a description of customers part in coloumn customer wise. Now we want to display in our skid invoice, like if we add a custpart in order line. So we want the display of value that we add in customer part description column with associate this customer part number.
3rd if custpart column is blank then display Cust part not added.
We can complete your customization for about 30 minutes of work at a rate of $315/hr billed at actual time to complete.
@rana826 I took a look at your tt file… I think you’re actually pretty close.
Change the cross part array line to this…
[% cross_parts_rs = skidline.part_record.get_cross_parts_rs( ‘customer_id’, skidline.customer_id ) %]
That will get an object that contains the records that are type Customer and have an object_id equal to the skidline customer_id
In your loop you can access the records by using .all
[% FOR cross_part IN cross_parts_rs.all %]
@cetecerp2 ,
Thanks its works
Regards,
Rana Muneeb
@cetecerp2
I am customizing my skid invoice and noticed that I can successfully retrieve cross part data using skidline.part_record
, but the same approach does not work when using order_line.part_record
. Could you explain why skidline.part_record
is able to access the necessary cross part records and bonus columns, while order_line.part_record
cannot? I want to understand the difference in how these relationships are set up within the Cetec system.
Regards,
Rana Muneeb
@rana826 I’m not sure the variable order_line has been initialized with anything in the skid documents. Generally you’ll need to look at how the standard doc is accessing the ordline from the skidline. But each skidline will have a different ordline associated, possibly from separate orders so it’s best to always get the ordline from the skidline you’re working with.
@cetecerp2
I would like to display the same information on my order label, but using order_line.part_record
doesn’t seem to work. Could you explain the difference in how these relationships are set up in the Cetec system, and how I might access the necessary cross part records and bonus columns for an order label?
Regards,
Rana Muneeb
@rana826 When customizing documents it’s best to use the same variables that are already defined or used in the document. If you see in the default doc that an ordline is being accessed in a particular way then you should follow that convention… there is no expectation that the variable order_line will store anything meaningful unless you see it’s already being used.